package com.yml.mall.user.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @ClassName UserDTO
 * @Author Administrator
 * @Date 2020/4/7   10:27
 */
@Data
@ApiModel("注册请求对象")
public class RegisterDTO {

    @ApiModelProperty(value = "ID")
    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名",required = true)
    private String username;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码",required = true)
    private String password;

    @NotBlank(message = "邮箱不能为空")
    @ApiModelProperty(value = "邮箱",required = true)
    private String email;

    @ApiModelProperty(value = "角色")
    private Integer role;

    public RegisterDTO(@NotBlank String username, @NotBlank String password, @NotBlank String email, @NotBlank Integer role) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.role = role;
    }
}
